load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "txnidcache",
    srcs = [
        "cluster_settings.go",
        "concurrent_write_buffer.go",
        "fifo_cache.go",
        "metrics.go",
        "txn_id_cache.go",
        "writer.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/contention/txnidcache",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/appstatspb",
        "//pkg/sql/contention/contentionutils",
        "//pkg/sql/contentionpb",
        "//pkg/util/encoding",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/uuid",
    ],
)

go_test(
    name = "txnidcache_test",
    srcs = [
        "fifo_cache_test.go",
        "main_test.go",
        "txn_id_cache_test.go",
        "writer_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":txnidcache"],
    deps = [
        "//pkg/base",
        "//pkg/kv",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/appstatspb",
        "//pkg/sql/contentionpb",
        "//pkg/sql/sessiondata",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
